package de.akabahn.ebd.fst.control;

import java.util.HashSet;
import java.util.Set;

/**
 * Class representing one client that is connected to the Fahrsteuerung-Control
 * application with it's attributes.
 * 
 * @author Peter Eimann
 * @since 1.0
 * @version 1.0
 */
public class Client {

	private Long lastPing;
	private Set<String> tfzAddressSet;

	/**
	 * The time in ms of the last ping command for this client
	 * 
	 * @return the lastPing
	 */
	public Long getLastPing() {
		return lastPing;
	}

	/**
	 * @param lastPing
	 *            the lastPing to set
	 */
	public void setLastPing(Long lastPing) {
		this.lastPing = lastPing;
	}

	/**
	 * The tfz addresses that are controlled by this client.
	 * 
	 * @return the tfzAddressSet
	 */
	public Set<String> getTfzAddressSet() {
		if (tfzAddressSet == null) {
			tfzAddressSet = new HashSet<String>();
		}
		return tfzAddressSet;
	}

	public String toString() {
		return lastPing + ", " + tfzAddressSet;
	}
}
